<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> 
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib tagdir="/WEB-INF/tags" prefix="tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>无标题文档</title>
	<link href="/res/css/style.css" rel="stylesheet" type="text/css" />
	<link href="/res/js/lib/layer/skin/layer.css" rel="stylesheet" type="text/css" />
	<link href="/res/js/lib/layer/skin/layer.ext.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="/res/js/jquery.js"></script>
	<script type="text/javascript" src="/res/js/lib/json2.js"></script>	
	<script type="text/javascript" src="/res/js/lib/layer/layer.js"></script>
	<script type="text/javascript" src="/res/js/common/msgTools.js"></script>
	<script language="javascript" type="text/javascript" src="/res/js/lib/datePicker/WdatePicker.js"></script>	
 	<script type="text/javascript" src="/res/js/pages/merchant/merchantList.js"></script> 
<style>
.tablelist img {
    margin:6px;
}
</style> 	
</head>
<body>
	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="#">首页</a></li>
    <li><a href="#">商家管理</a></li>
    <li><a href="#">${!QUERY?"商家列表":"商家查询"}</a></li>
    </ul>
    </div>
    
    <div class="rightinfo">   
    <form id="exportForm" action="/merchant/list/export" method="post">
       <input type="hidden" name="createTime"/>
       <input type="hidden" name="createTime1"/>    
    </form>   
    <form id="queryForm" action='/merchant/list${!QUERY?"":"?__query__"}' method="post"> 
    <div class="tools" style="margin:3px 0px;background: #efefef;padding:6px 0px;">  
        <span class="toolbar" style="margin-left:10px;">
        商家户名：<input name="merchantName" value="${qry.merchantName}" type="text" class="dfinput" style="width:150px;"/>
                      用户名：<input name="userName" value="${qry.userName}" type="text" class="dfinput" style="width:100px;"/>		                         
                       手机号：<input name="mobile" value="${qry.mobile}" type="text" class="dfinput" style="width:150px;"/>
                       申请时间：<input id="d12" name="createTime" value="${qry.createTime}" type="text" class="dfinput" style="width:100px;" onClick="WdatePicker()"/>
              <img onclick="WdatePicker({el:'d12'})" src="/res/js/lib/datePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">至
              <input id="d13" name="createTime1" value="${qry.createTime1}" type="text" class="dfinput" style="width:100px;" onClick="WdatePicker()"/>
              <img onclick="WdatePicker({el:'d13'})" src="/res/js/lib/datePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">             
        </span>
    	<ul class="toolbar" style="margin-left:20px;">
	        <li onclick="$('#queryForm').submit()"><span><img src="/res/images/ico06.png" /></span>搜索</li>
	         <c:if test='${!QUERY}'><li onclick="selDateRange()"><span><img src="/res/images/f05.png" /></span>导出</li></c:if>
        </ul>    
    </div>
    
    <table class="tablelist">
    	<thead>
	    	<tr>
	        <th align="center" class="chk"><input id="chkAll" type="checkbox" value="" /></th>
	        <th width="36">编号</th>
	        <th width="100">商户图片</th>
			<th>商户名称</th>
			<th>用户名</th>
			<th>省份</th>
			<th>城市</th>
			<th>地区</th>	
			<th>经营项目</th>
			<th>推荐权重</th>
			<th>申请状态</th> 
			<th>申请时间</th>
			<c:if test='${!QUERY}'><th>操作</th></c:if>   
	        </tr>
        </thead>
        <tbody>        
	        <c:forEach items="${list}" var="row" varStatus="status">
 		        <tr>
		        <td align="center"><input id="chk_${row.id}" type="checkbox" value="${row.id}" /></td>
		        <td>${status.index+1}</td>
		        <td>
		            <a href='${!empty(row.img_cover)?row.img_cover:!empty(row.img_cover_small)?row.img_cover_small:"/res/images/nopic2.png"}' target="_blank">
                      <img src='${!empty(row.img_cover_small)?row.img_cover_small:!empty(row.img_cover)?row.img_cover:"/res/images/nopic2.png"}' width="90" height="50"/>
                    </a>
                </td>
		        <td>${row.merchant_name}<br/>
		                             详细地址:${row.address}
		        </td>		        
		        <td><a href="javascript:viewUser(${row.userid})" class="tablelink">${row.user_name}</a><br/>
		        	商户电话:${row.mobile}
		        </td>
		        <td>${row.province_name}</td>		        
		        <td>${row.city_name}</td>
		        <td>${row.area_name}</td>
		        <td>${row.category_name}</td>
		        <td>${(!empty(row.recmd_sort)&&row.recmd_sort>0)? row.recmd_sort:"" }</td>	  
		        <td>${ (!empty(row.status) &&row.status==0?"待审核":(row.status==1?"通过审核":(row.status==2?"未通过审核":"")))}</td>		        	
		        <td>
		            <a class="tablelink" href="javascript:viewMerchantImg('${row.id}')">展示照</a><br/>
		            <fmt:formatDate value="${row.create_time}" pattern="yyyy-MM-dd HH:mm"/>
		        </td>
		        <c:if test='${!QUERY}'>	
		        <td>
		          <a href="javascript:setRecomend('${row.id}','${(!empty(row.recmd_sort)&&row.recmd_sort>0)? row.recmd_sort:"" }')" class="tablelink">设置推荐</a>
		          <a href="javascript:edit('${row.id}')" class="tablelink">编辑</a>
		        </td>
		        </c:if>	
		        </tr>  
	        </c:forEach>
         </tbody>
    </table>   
    </form>
      
    <tags:pager pagerRange="10" pageSize="${pager.pageSize}" totalPage="${pager.pageCount}" curIndex="${pager.pageIndex}" rowCount="${pager.rowCount}" formId="queryForm"></tags:pager> 
 
    
    </div>
    
    <script type="text/javascript">
	   $('.tablelist tbody tr:odd').addClass('odd');
	</script>

</body>

</html>
